﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Campus {
    class BuildingStructure : Structure {
        private BuildStructureAbility m_owningAbility;
        public BuildStructureAbility OwningAbility
        {
            get { return m_owningAbility; }
        }

        private void CreateAbilities() {
            Abilities.Add("Garrison", new GarrisonAbility(MenuIcons.GarrisonIcon, this, 1000, delegate(Unit u) { if(((GarrisonAbility)Abilities["Garrison"]).GarrisonedUnits.Count < 1) return true; return false;}));
            Abilities.Add("Expell Units", new ExpellUnitsAbility(MenuIcons.ExpellIcon, this));
        }
        public BuildingStructure(BuildRequirements.Buildings type, Player owner, Level level, BuildStructureAbility owningAbility)
            : base(BuildRequirements.GetStructureConstructionTexture(type), BuildRequirements.GetStructureTeamColorTexture(type),
                BuildRequirements.GetStructureConstructionTexture(type), BuildRequirements.GetStructureTilesOccupied(type),
                BuildRequirements.GetStructureOrigin(type), Vector2.Zero, 1000, owner, level, new Dictionary<string,Ability>(),
                new Dictionary<string,AbilitySubMenu>()) {
            CreateAbilities();
            m_owningAbility = owningAbility;
        }
        public override string ToString() {
            return "This structure is currently building.";
        }
        public override void Update(Player Player) {
        }
    }
}
